package com.example.lotterysystem.common.enums;

import lombok.Getter;

@Getter
public enum PrizeGradeEnum {

    FIRST_PRIZE(1, "一等奖"),
    SECOND_PRIZE(2, "二等奖"),
    THIRD_PRIZE(3, "三等奖");


    PrizeGradeEnum(){

    }

    PrizeGradeEnum(Integer code, String value){
        this.code = code;
        this.value = value;
    }
    private String value;
    private Integer code;

    public static PrizeGradeEnum forName(String name){
        for (PrizeGradeEnum prizeGradeEnum : PrizeGradeEnum.values()) {
            if(prizeGradeEnum.name().equalsIgnoreCase(name)){
                return prizeGradeEnum;
            }
        }
        return null;
    }
}
